﻿using CfgTable;

namespace IQIGame.Onigao.GamePlay
{
    public class UIN_WarehouseItem : UIN_OneItem
    {
        public ItemData itemData { get; private set; }

        protected override void OnDispose()
        {
            this.itemData = null;
            base.OnDispose();
        }

        public void Show(ItemData itemData)
        {
            this.itemData = itemData;
            CfgItem cfgItem = itemData?.cfgData;
            bool isOkey = base.Show(cfgItem);
            if (!isOkey)
            {
                itemData = null;
                return;
            }
            this.Show();
            this.SetCount(itemData.num, true);
        }
    }
}
